-
Notifications
You must be signed in to change notification settings - Fork 114
feat(csharp/src/Drivers/Apache): enhance GetColumns with BASE_TYPE_NAME column #2695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(csharp/src/Drivers/Apache): enhance GetColumns with BASE_TYPE_NAME column #2695
Conversation
int rowCount = HiveServer2Reader.GetRowCount(rowSet, columnCount); | ||
|
||
// Get metadata again to ensure we have the latest | ||
TGetResultSetMetadataResp metadata = await HiveServer2Connection.GetResultSetMetadataAsync(OperationHandle!, Connection.Client, cancellationToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a duplicate call with the call to GetResultSetSchemaAsync
. Is there any way to avoid the extra call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per Bruce's comment, the else
clause of GetColumnsAsync
should be modified to call GetResultSetSchemaAsync
only once and then compute the Arrow schema based on the result of that call by using SchemaParser.GetArrowSchema
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Please clean up a little extra whitespace that the linter doesn't like and then this can be checked in.
Summary
This PR enhances the C# ADBC driver's
GetColumns
functionality by adding a newBASE_TYPE_NAME
column to the result set. This column provides the base type name without parameters or decorations, making it easier for clients to identify the fundamental data type regardless of its parameterization.Proposed Changes
BASE_TYPE_NAME
column to theGetColumns
result schemaHiveServer2Statement
class to process and populate theBASE_TYPE_NAME
columnprotected
topublic
orinternal
to enable the enhancementVARIANT
SQL type in theSqlTypeNameParser
Implementation Details
The implementation:
GetColumns
query resultsSetPrecisionScaleAndTypeName
methodBenefits
Testing
Added comprehensive unit tests that verify: